﻿using System;
using System.IO.IsolatedStorage;

namespace lutianqi
{
    public class ValueHelper
    {
        private static IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;
        public static void SetVaule(string ID, object value)
        {
            appSettings.Remove(ID);

            if (!appSettings.Contains(ID))
            {
                appSettings.Add(ID, value);
            }
            appSettings.Save();
        }
        public static object GetValue(string ID)
        {
            object result;
            if (appSettings.Contains(ID))
            {
                result = appSettings[ID];
            }
            else
            {
                result = null;
            }
            return result;
        }
    }
}
